package com.pimee.common.util.web;

import org.springframework.ui.ModelMap;

import com.pimee.common.core.support.HttpCode;


public class Result {

	/**
	 * 成功结果提示 不带数据
	 * 
	 * @return
	 */
	public static ModelMap ok() {
		ModelMap modelMap = new ModelMap();
		modelMap.put("code", HttpCode.OK.value());
		modelMap.put("msg", HttpCode.OK.msg());
		modelMap.put("timestamp", System.currentTimeMillis());
		return modelMap;
	}
	/**
	 * 成功结果提示 不带数据
	 * @param msg
	 * @return
	 */
	public static ModelMap ok(String msg) {
		ModelMap modelMap = new ModelMap();
		modelMap.put("code", HttpCode.OK.value());
		modelMap.put("msg", msg);
		modelMap.put("timestamp", System.currentTimeMillis());
		return modelMap;
	}
	public static Object error(String msg) {
		ModelMap modelMap = new ModelMap();
		modelMap.put("code", HttpCode.OK.value());
		modelMap.put("msg", msg);
		modelMap.put("timestamp", System.currentTimeMillis());
		return modelMap;
	}
}
